package com.ruoyi.web.controller.util;

import java.sql.Timestamp;

/****
 * 数据判断工具类
 */
public class DataUtils {

    /**
     * 自定义ID序号
     */
    public static String fuwUUID(String beanName){
        // 获取当前时间戳
        Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        String timeNow = String.valueOf(timestamp.getTime());
        // 拼接字符串
        String name = beanName + timeNow;
        return name;
    }

    /**
     * String类型判断为空，清除空格内容
     */
    public static String dataString(String stringName){
        String entity = null;
        if(stringName != null && !stringName.equals("")){
            entity = stringName.trim();
        }
        return entity;
    }

    /**
     * Integer类型判断为空
     */
    public static Integer dataInteger(Integer integerName){
        Integer entity = null;
        if(integerName != null){
            entity = integerName;
        }
        return entity;
    }

}
